package rickyGame.game
{
	import ricky.game.Actor;
	import ricky.game.graphic.Graphic;
	
	import rickyGame.game.property.Ai;
	import rickyGame.game.property.FightPro;
	import rickyGame.game.property.Skill;
	/**
	 * 地图上的物品
	 */
	public class Goods extends Fighter
	{
		public function Goods()
		{
			_ai=new  Ai(this);
			graphic=new Graphic(this);/// FightGraphic
			_fightPro=new FightPro(this);
			_skills=new Skill(this);
			_stateNames=new Array();

		}
		
		override public function set name(value:String):void
		{
			super.name=value;
			Graphic(graphic).infoTxt=value;
		}
		
		override public function load(uint:Object):void
		{
			super.load(uint);
			this.name=uint.name;
			this.asType="ground";
			this.ai.init(uint.perception);
		}

		/**
		 * 根据等级加载数据
		 */
		override public function loadProperty(level:int):void
		{
			var sps:Array=super.data.ability.split(",");//技能
			
			for each(var skillName:String in sps)
				skills.learn(skillName);
			
		}

		/**
		 * 物品所有者
		 */
		public function get owner():Fighter
		{
			return _owner;
		}

		public function set owner(value:Fighter):void
		{
			_owner = value;
		}


		//private
		
		private var _owner:Fighter;//所有者
	}
}